﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RedHouse.Data.Service;
using RedHouse.Data.Base;
using RedHouse.Data.Common;

namespace RedHouse.AdminControl.UserControls
{
    public partial class UCNewsList : System.Web.UI.UserControl
    {
        INewsService _newService;
        protected void Page_Load(object sender, EventArgs e)
        {
            Initialize();
        }

        private void Initialize()
        {
            _newService = new NewsService();
            rptNews.DataSource = _newService.GetAllNewsByGroup(RedHouseGroup.GroupList[0].Value).OrderByDescending(n=>n.CreatedDate);
            rptNews.DataBind();
        }
    }
}